{#include file="top.php"#}
<script type="text/javascript" src="/js/ZeroClipboard.js"></script>
<script type="text/javascript">
    function select(){
        var s = $("#select_c");
        if(parseInt(s.attr('v'))==0){
            s.show();
            s.attr('v',1);
        }else{
            s.hide();
            s.attr('v',0);
        }
    }

    function callback(content){
        switch(content['retcode']){
            case 1:
                break;
            case 2:
                $('#blog_tr_'+content['data']['bid']).remove();
                break;
            case 3:
                showpop("Blog 發佈成功！");
                $('#pub_n_'+content['data']['bid']).removeClass().addClass("atc_title").attr("href", content['data']['url']);
                $('#pub_b_'+content['data']['bid']).remove();
                break;
            default:
                break;
        }
    }

    function showLB(ct,n){
        var sh=$(document).height();
        var sw=$(document).width();
        var st=$(window).scrollTop();
        var ch=$(window).height();
        var cw=$(window).width();
        var tbT=(Number(ch)/3+Number(st))+"px";
        var tbL=(Number(cw)/2)+"px";
        if(n==0){
            $("#fullbg").css({width:sw,height:sh});
            $(ct).css({top:tbT,left:tbL});
            $("#fullbg").fadeTo('slow', 0.4);
            $(ct).fadeIn('slow');
            $(window).scroll(function(){showLB(ct,1)});
            $(window).resize(function(){showLB(ct,1)});
        }else{
            if($("#fullbg").css("display")=="block"){
                $("#fullbg").css({width:sw,height:sh});
                $(ct).css({top:tbT,left:tbL});
            }
        }
    }

    function closeLB(){
        $("#fullbg").fadeOut('slow');
        $('#dialog').fadeOut('slow');
        $('#dialog_popup').fadeOut('slow');
        $('#dialog1').fadeOut('slow');



    }

    function showpop(text){
        showLB('#dialog_popup',0);
        $("#popupText").text(text);
    }

    var clip = null;
    $(document).ready(function(){
        clip = new ZeroClipboard.Client();
        clip.setHandCursor( true );

        clip.addEventListener('load', function (client) {
        });

        clip.addEventListener('mouseOver', function (client) {
            clip.setText( $('#share_url').val() );
        });

        clip.addEventListener('complete', function (client, text) {
            alert('複製成功');
        });

        clip.glue( 'copy_bt');
    });
</script>

<div class="body">
    <div class="main fl">
        <div class="tips" style='{#if empty($msg)#}display:none;{#/if#}'>
            <strong class="ir warn_icon"><span>提示</span></strong>
            <label id='message'>{#$msg#}</label>
        </div>

        <div class="ibox clearfix">
            <figure class="imgbox">
                <a href="{#optimize_url('person', 'report','username='|cat:$member.username)#}"><img src="{#$member.photo_l#}"  width=77> </a>
            </figure>
            <h3 class="title">
                <a class="title" href="{#optimize_url('person', 'report','username='|cat:$member.username)#}">{#$member.username#}</a>
                <span class="myreport">我的報告：{#$member.reports_count#}</span>
                <a href="/member.php?action=MyReg" class="btn_b btn_b_editfile"><strong>編輯個人檔案</strong></a>
            </h3>
<!--            <p>年齡：{#$member.age_group#}</p>
            <p>膚質：{#$member.body_skin#}</p>
            {#if $member.fav_brand_top#}
            <p>最愛品牌：{#$member.fav_brand_top#}
                {#if $member.fav_brand#}
                <i class="tri down" onclick="$('.brand_all').slideToggle('fast');"></i>
                {#/if#}
            </p>
            {#/if#}
            <div class="brand_all" style="display:none">{#$member.fav_brand#}</div>

            {#if $member.reports_count#}<p>提交報告：{#$member.reports_count#}</p>{#/if#}
            {#if $memberData.facebook.id#}<p>已綁定facebook {#$memberData.email#}</p>{#/if#}-->

            <div class="point_record">
                <table class="point_record_tb">
                    <tr>
                        <td class="td1">
                            <a href="/member_center.php?action=points#show_point">詳細記錄</a>
                        </td>
                        <td class="td2">
                            <a href="{#optimize_url('help', 'show','page=4')#}" target="_blank">如何賺分？</a>
                        </td>
                        <td class="td3">
                            <span class="now">現有
                                iTrial分</span><span class="font_red">{#$member.points#}</span><a href="{#optimize_url('help', 'show','page=4')#}" target="_blank"><i class="icon point"></i></a>
                        </td>
                    </tr>
                </table>

            </div>
            <div class="btnsbox">
                <div class="flbox">
                    <a href="/member_center.php?action=blog_do&do=1" class="btn_b btn_b_edit">編寫blog</a>
                    {#if empty($member.member_type)#}<a href='/member.php?action=regTrial' class="btn_b btn_b_totrydaren"><strong>成為試用專員</strong></a>
                    {#else if $isexp neq 1#}<a href='/member.php?action=regExpert' class="btn_b btn_b_todaren"><strong>成為體驗達人</strong></a>{#/if#}
                </div>
                <div class="frbox">
                    <em class="icon {#if $member.member_type eq 5#}ycicon{#else if $member.member_type eq 1#}icon_master_g{#else#}icon_master_m{#/if#}">{#if $member.member_type eq 5#}尊業體驗團{#else if $member.member_type eq 1#}試用專員{#else#}正式會員{#/if#}</em>
                </div>
                {#if $member._status eq 1#}<p class="statu">審核中</p>{#/if#}
            </div>
        </div>
        <div class="point_intro">
            <p class="recom">推介朋友賺取iTrial分：<input type="text" class="ipt_text" id="share_url" readOnly="readOnly" value="{#$member.share_url#}"/><a class="point_copy" href="javascript::" id="copy_bt"><strong>複製</strong></a><a target="_blank" href="{#optimize_url('help', 'show','page=4')#}" class="icon question"></a></p>
            <p class="share">你可以透過任何方法，推介朋友申請成為試用專員或體驗達人，便可賺取 1 個 iTrial 分，每天上限為 5 分，即推介 5 位朋友。</p>
        </div>

        <div class="b_box cr_tagb_box list_row tagb_box">
            <div class="slt slt_d" onclick="select()">
                <strong class="tri down"></strong>
            </div>
            <div class="sltbox sltbox_d">
                <div class="dt" onclick="select()">
                    {#$select.$option#}
                </div>
                <div id="select_c" v=0 class="dd" style="display:none">
                    {#foreach  from=$select item=v key=k#}
                    <p><a href="/member_center?action=blog&option={#$k#}">{#$v#}</a></p>
                    {#/foreach#}
                </div>
            </div>
            <div class="tab_b_box tab_b_box_l tab_b_box_m">
                <a href="/member_center.php?action=invite">產品 / 活動</a>
                <a href="/member_center.php?action=report">產品報告</a>
                <a href="/member_center.php?action=attention">關注會員</a>
                <a href="/member_center.php?action=points">iTrial分</a>
                <a class="curr" href="/member_center.php?action=blog">Blog</a>
                <em class="line"></em>
            </div>

            <p class="t_title">我的Blog</p>
            <div class="ti_box">
                <div class="bd">
                    {#foreach  from=$my_blogs.result item=v key=k#}
                    <div class="article_box" {#if ($k+1) eq count($my_blogs.result)#}style="border-bottom:none;"{#/if#} id="blog_tr_{#$v.id#}">
                        <h3><a class="{#if intval($v.is_publish) eq 1#}atc_title{#else#}draft_title{#/if#}" id="pub_n_{#$v.id#}" href="{#if intval($v.is_publish) eq 1#}{#optimize_url('person', 'blog','username='|cat:$member.username|cat:'&bid='|cat:$v.id)#}{#else#}/member_center.php?action=blog_do&do=2&bid={#$v.id#}{#/if#}">{#$v.title#}</a></h3>
                        <p>{#$v.time#}</p>
                        <p>{#$v.body#}</p>
                        <ul class="clearfix" style="margin-top: 5px;margin-bottom: 5px;">
                            {#foreach  from=$v.pic item=v2 key=k2#}
                            <li style="float: left;margin-right: 5px;">
							<div class="img_box"><p class="img_p"><a href="{#if intval($v.is_publish) eq 1#}{#optimize_url('person', 'blog','username='|cat:$member.username|cat:'&bid='|cat:$v.id)#}{#else#}/member_center.php?action=blog_do&do=2&bid={#$v.id#}{#/if#}"><span><img src="{#$v2#}"></span></a></p></div>
							</li>
                            {#/foreach#}
                        </ul>
                        <div class="blog_btn_box">
                            {#if intval($v.is_publish) neq 1#}<a href="/member_center.php?action=blog_do&do=4&bid={#$v.id#}" id="pub_b_{#$v.id#}" target="iframe1" class="btn_s btn_s_blog_submit"><strong>發布</strong></a>{#/if#}
                            <a href="/member_center.php?action=blog_do&do=2&bid={#$v.id#}" class="btn_s btn_s_blog_edit"><strong>編輯</strong></a>
                            <a href="/member_center.php?action=blog_do&do=3&bid={#$v.id#}" class="btn_s btn_s_blog_del" target="iframe1"><strong>刪除</strong></a>
                        </div>
                    </div>
                    {#/foreach#}
                </div>
            </div>
            {#$pagelist5#}

        </div><!--tagb_box-->
    </div>
    <!-- main-->
    <div class="sidebar">
        {#show_block('b2',1,'','sidebar_ad')#}
        {#show_block('b1',2,'','sidebar_function')#}
        {#show_block('b3',0,'','sidebar_search')#}
        {#show_block('b9',0,'','sidebar_tutorial b_box')#}
        {#show_block('b6',0,'','sidebar_facebook')#}
    </div>
    <!-- sidebar -->

</div><!--body-->
<div id="fullbg"></div>
<div style="top:400px;z-index:60;display:none;" class="apopbox popbox b_box" id="dialog_popup">
    <div class="hd">
        <h2 class="ir ht"><span>提示信息 ALERT</span></h2>
        <a class="popclose" onclick="closeLB();" style="cursor:pointer">close</a>            </div>
    <div class="bd">
        <p id="popupText"></p>
        <a class="btn_b btn_s_im_back" href="javascript:void(0);" onclick="closeLB();"><strong>立即返回</strong></a>
    </div>
</div>
<iframe id="iframe1" name="iframe1" style="display:none"></iframe>
{#include file="footer.php"#}